// app.js
App({
  onLaunch (options) {
    let accountInfo = wx.getAccountInfoSync()
    switch(accountInfo.miniProgram.envVersion){
      case 'develop':
        this.globalData.baseUrl = 'http://127.0.0.1:3000'
        break;
      case 'trial':
          this.globalData.baseUrl = 'http://127.0.0.1:4000'
          break;
      case 'release':
          this.globalData.baseUrl = 'http://api.xxxxx.com'
          break;
    }
    console.log('app-onLaunch')
  },
  onShow (options) {
    console.log('app-onShow')
  },
  onHide () {
    console.log('app-onHide')
  },
  onError (msg) {
    console.log('app-onError')
  },
  globalData:{
    title:'hello world',
    baseUrl:'http://127.0.0.1:3000',
    dateFormat(){
      console.log('dateFormat')
    }
  }
})
